summaryrefslogtreecommitdiff
path: root/app/[lng]/engineering/(engineering)/document-list-only/page.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'app/[lng]/engineering/(engineering)/document-list-only/page.tsx')
-rw-r--r--app/[lng]/engineering/(engineering)/document-list-only/page.tsx98
1 files changed, 0 insertions, 98 deletions
diff --git a/app/[lng]/engineering/(engineering)/document-list-only/page.tsx b/app/[lng]/engineering/(engineering)/document-list-only/page.tsx
deleted file mode 100644
index 5b49a6ef..00000000
--- a/app/[lng]/engineering/(engineering)/document-list-only/page.tsx
+++ /dev/null
@@ -1,98 +0,0 @@
-// evcp/document-list-only/page.tsx - 전체 계약 대상 문서 목록
-import * as React from "react"
-import { Suspense } from "react"
-import { Skeleton } from "@/components/ui/skeleton"
-import { type SearchParams } from "@/types/table"
-import { getValidFilters } from "@/lib/data-table"
-import { DocumentStagesTable } from "@/lib/vendor-document-list/plant/document-stages-table"
-import { documentStageSearchParamsCache } from "@/lib/vendor-document-list/plant/document-stage-validations"
-import { getDocumentStagesOnly } from "@/lib/vendor-document-list/plant/document-stages-service"
-
-interface IndexPageProps {
- searchParams: Promise<SearchParams>
-}
-
-// 문서 테이블 래퍼 컴포넌트 (전체 계약용)
-async function DocumentTableWrapper({
- searchParams
-}: {
- searchParams: SearchParams
-}) {
- const search = documentStageSearchParamsCache.parse(searchParams)
- const validFilters = getValidFilters(search.filters)
-
- // 필터 타입 변환
- const convertedFilters = validFilters.map(filter => ({
- id: (filter.id || filter.rowId) as string,
- value: filter.value,
- operator: (filter.operator === 'iLike' ? 'ilike' :
- filter.operator === 'notILike' ? 'notin' :
- filter.operator === 'isEmpty' ? 'eq' :
- filter.operator === 'isNotEmpty' ? 'ne' :
- filter.operator === 'isBetween' ? 'eq' :
- filter.operator === 'isRelativeToToday' ? 'eq' :
- filter.operator || 'eq') as 'eq' | 'in' | 'ne' | 'lt' | 'lte' | 'gt' | 'gte' | 'like' | 'ilike' | 'notin'
- }))
-
- // evcp: 전체 계약 대상으로 문서 조회
- const documentsPromise = getDocumentStagesOnly({
- ...search,
- filters: convertedFilters,
- }, -1) // 세션에서 자동으로 도메인 감지
-
- return (
- <DocumentStagesTable
- promises={Promise.all([documentsPromise])}
- contractId={-1} // 전체 계약을 의미
- projectType="plant" // 기본값으로 plant 사용
- />
- )
-}
-
-function TableLoadingSkeleton() {
- return (
- <div className="space-y-4">
- <div className="flex items-center justify-between">
- <Skeleton className="h-6 w-32" />
- <div className="flex items-center gap-2">
- <Skeleton className="h-8 w-20" />
- <Skeleton className="h-8 w-24" />
- </div>
- </div>
- <div className="rounded-md border">
- <div className="p-4">
- <div className="space-y-3">
- {Array.from({ length: 5 }).map((_, i) => (
- <div key={i} className="flex items-center space-x-4">
- <Skeleton className="h-4 w-4" />
- <Skeleton className="h-4 w-24" />
- <Skeleton className="h-4 w-48" />
- <Skeleton className="h-4 w-20" />
- <Skeleton className="h-4 w-16" />
- <Skeleton className="h-4 w-12" />
- </div>
- ))}
- </div>
- </div>
- </div>
- </div>
- )
-}
-
-// 메인 페이지 컴포넌트
-export default async function DocumentStagesManagementPage({
- searchParams
-}: IndexPageProps) {
- const resolvedSearchParams = await searchParams
-
- return (
- <div className="mx-auto">
- {/* 문서 테이블 */}
- <Suspense fallback={<TableLoadingSkeleton />}>
- <DocumentTableWrapper
- searchParams={resolvedSearchParams}
- />
- </Suspense>
- </div>
- )
-} \ No newline at end of file